<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextItem class provides all the information required to
draw text in a custom paint engine. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtextitem.html#RenderFlag-enum">RenderFlag</a></b> { RightToLeft, Overline, Underline, StrikeOut }</li><li><div class="fn" />class <b><a href="qtextitem-renderflags.html">RenderFlags</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextitem.html#QTextItem">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextitem.html#QTextItem-2">__init__</a></b> (<i>self</i>, QTextItem)</li><li><div class="fn" />float <b><a href="qtextitem.html#ascent">ascent</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextitem.html#descent">descent</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qtextitem.html#font">font</a></b> (<i>self</i>)</li><li><div class="fn" />RenderFlags <b><a href="qtextitem.html#renderFlags">renderFlags</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextitem.html#text">text</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextitem.html#width">width</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextItem class provides all the information required to
draw text in a custom paint engine.</p>
<p>When you reimplement your own paint engine, you must reimplement
<a href="qpaintengine.html#drawTextItem">QPaintEngine.drawTextItem</a>(),
a function that takes a QTextItem as one of its arguments.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="RenderFlag-enum" />QTextItem.RenderFlag</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTextItem.RightToLeft</tt></td>
<td class="topAlign"><tt>0x1</tt></td>
<td class="topAlign">Render the text from right to left.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextItem.Overline</tt></td>
<td class="topAlign"><tt>0x10</tt></td>
<td class="topAlign">Paint a line above the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextItem.Underline</tt></td>
<td class="topAlign"><tt>0x20</tt></td>
<td class="topAlign">Paint a line under the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextItem.StrikeOut</tt></td>
<td class="topAlign"><tt>0x40</tt></td>
<td class="topAlign">Paint a line through the text.</td>
</tr>
</table>
<p>The RenderFlags type is a typedef for <a href="qflags.html">QFlags</a>&lt;RenderFlag&gt;. It stores an OR
combination of RenderFlag values.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextItem" />QTextItem.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QTextItem-2" />QTextItem.__init__ (<i>self</i>, <a href="qtextitem.html">QTextItem</a>)</h3><h3 class="fn"><a name="ascent" />float QTextItem.ascent (<i>self</i>)</h3><p>Corresponds to the <a href="qfontmetrics.html#ascent">ascent</a>
of the piece of text that is drawn.</p>


<h3 class="fn"><a name="descent" />float QTextItem.descent (<i>self</i>)</h3><p>Corresponds to the <a href="qfontmetrics.html#descent">descent</a> of the piece of text that
is drawn.</p>


<h3 class="fn"><a name="font" /><a href="qfont.html">QFont</a> QTextItem.font (<i>self</i>)</h3><p>Returns the font that should be used to draw the text.</p>


<h3 class="fn"><a name="renderFlags" /><a href="qtextitem-renderflags.html">RenderFlags</a> QTextItem.renderFlags (<i>self</i>)</h3><p>Returns the render flags used.</p>


<h3 class="fn"><a name="text" />QString QTextItem.text (<i>self</i>)</h3><p>Returns the text that should be drawn.</p>


<h3 class="fn"><a name="width" />float QTextItem.width (<i>self</i>)</h3><p>Specifies the total width of the text to be drawn.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>